<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<!-- 月历 -->
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/ui.jqgrid.css" />
<link href="/css/ddaccordion.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<script src="/js/grid.locale-en.js" type="text/javascript"></script>
<script src="/js/jquery.jqGrid.min.js" type="text/javascript" charset="UTF-8"></script>
<s:url var="supplierPops" value="/json/supplierPops.do"/>
<s:url var="brandPops" value="/json/brandPops.do"/>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.alphanumeric.js"></script>
<script language="javascript">
	$().ready( function() {
		
	});
</script>
<style type="text/css">
    .bg-active {
        background: #D4FAED;
    }
</style>
<h1>N选M商品管理<br/>
</h1>
<c-rt:if test="${not empty product.productId}">
	<jsp:include page="commonMenu2.jsp"/>
</c-rt:if>
<div class="f-link">
		<a href="<%=ServerValue.getFrontHostname()+ServerValue.getFrontContextPath()%>/product/productPreview.do?productId=${product.productId}" target="_blank">商品预览</a>
		<a href="${midContextPath}/pickProduct2/addShelf.do?productIdParam=${product.productId}">新增上下架</a>
		<a href="<%=ServerValue.getMidContextPath()%>/pickProduct2/search.do">返回列表页</a>
	</div>
<br/>
<div class="data-form">
	<s:form action="shelfSearch.do" method="post">
     	<b>状态：</b> 
     	 <select id="shelfStParam" name="shelfStParam">
	    	<option value="SHF500" <c-rt:if test="${shelfStParam eq 'SHF500'}">selected="selected"</c-rt:if>>有效</option>
	    	<option value="SHF000" <c-rt:if test="${shelfStParam eq 'SHF000'}">selected="selected"</c-rt:if>>无效</option>
	    	<option value="" <c-rt:if test="${shelfStParam eq ''}">selected="selected"</c-rt:if>>全部</option>
    	</select>    	
		<input type="button" value="查询" onclick="this.form.submit();" />
		有效（已审核）无效（下架)
	</s:form>
</div>
<p></p>
<span class='txt-rd'><s:actionerror /></span>
<span class='txt-rd'><s:actionmessage /></span>
<span class='txt-rd'><s:fielderror /></span>
<s:form action="updateShelfStatus.do" method="post" id="shelfForm">
	<table class="tb-data" width="100%">
		<tr>
			<th width="20%">商品名称<br/>(商品编号)</th>
			<td>${product.productName}</td>
		</tr>
	</table>
	<br/>
	<table class="tb-1" width="100%">
		<thead>
			<tr>
			<th>下架</th>
			<th>上架状态</th>
			<th>商品促销小标</th>
			<th>商品活动任选<br/>商品可选件数</th>
			<th>上架起始日期时间</th>
			<th>上架结束日期时间</th>
			<th>最后修改日期</th>
			<th>上架售价</th>
			<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c-rt:forEach items="${shelfs}" var="shelf" varStatus="rows_index">
				<tr class="${shelfNow.shelfId == shelf.shelfId? 'bg-active' : ''}" id="tdDesc_${rows_index.count}" title="建立者:${shelf.createUser} 建立日期:${shelf.createDate}<br/>修改者:${shelf.modifyUser} 修改日期:${shelf.modifyDate}">
				        <c-rt:choose>
					        <c-rt:when test="${shelf.shelfStatus ne 'SHF700'}">
					        	<td><input name="shelfStatus" type="checkbox" value="${shelf.shelfId}" id="cb_${rows_index.count}"/></td>
					        </c-rt:when>
					        <c-rt:otherwise><td></td></c-rt:otherwise>
				        </c-rt:choose>
				        <td>${shelfStatusMenu.options[shelf.shelfStatus].name}</td>
				    	<td>${shelf.promoteName}</td>
				    	<td>${product.pickupQty}</td>
				    	<td><fmt:formatDate value='${shelf.startDate}' pattern='yyyy-MM-dd' /> <fmt:formatDate value='${shelf.startDate}' pattern='HH:mm' /></td>
				    	<td><fmt:formatDate value='${shelf.endDate}' pattern='yyyy-MM-dd' /> <fmt:formatDate value='${shelf.endDate}' pattern='HH:mm' /></td>
				    	<td><fmt:formatDate value='${shelf.modifyDate}' pattern='yyyy-MM-dd' /> <fmt:formatDate value='${shelf.modifyDate}' pattern='HH:mm' /></td>
				    	<td><fmt-rt:formatNumber value="${shelf.shelfPrice}" pattern="#####0.0" var="shelfPrice"/>${shelfPrice}</td>
				    	<td><a href="${midContextPath}/pickProduct2/editShelf.do?productIdParam=${product.productId}&shelfIdParam=${shelf.shelfId}">编辑</a></td>
		 		 </tr>  
		</c-rt:forEach>
		</tbody>
	</table>
	<br />
	<input type="submit" value="批次下架"/>	
	<br/><br/>
	<a href="${midContextPath}/pickProduct2/editPickProduct.do?productIdParam=${product.productId}">< 返回上一步</a>
	<div class="f-link">
		<a href="<%=ServerValue.getFrontHostname()+ServerValue.getFrontContextPath()%>/product/productPreview.do?productId=${product.productId}" target="_blank">商品预览</a>
		<a href="${midContextPath}/pickProduct2/addShelf.do?productIdParam=${product.productId}">新增上下架</a>
		<a href="<%=ServerValue.getMidContextPath()%>/pickProduct2/search.do">返回列表页</a>
	</div>
</s:form>
